package com.ftg.learn.day08;

import java.util.Arrays;

/**
 * 班级
 *
 * @author 布衣
 */
public class Clazz {

    private String name;
    private String address;
    private int size;
    private Student[] stus = new Student[100];
    public Student[] getAllStudent(){
        return Arrays.copyOf(this.stus,this.getSize());
    }

    public void addStu(Student stu){
        if(size >= stus.length){
            throw new RuntimeException("超过最大人数");
        }
        stus[size++] = stu;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public int getSize() {
        return size;
    }




}
